package com.example.live.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView

import com.example.image.glide.GlideImgLoader
import com.example.live.databinding.GuanzhuItemBinding
import com.example.live.entity.UserEntity

import javax.inject.Inject

class RankingAllAdapter @Inject constructor(private val data:List<UserEntity>):RecyclerView.Adapter<RankingAllAdapter.commentsViewHolder>() {
    inner class commentsViewHolder(val itembinding: GuanzhuItemBinding):RecyclerView.ViewHolder(itembinding.root)

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): commentsViewHolder {
        return commentsViewHolder(GuanzhuItemBinding.inflate(LayoutInflater.from(parent.context),parent,false))
    }

    override fun getItemCount(): Int = data.size

    override fun onBindViewHolder(holder: commentsViewHolder, position: Int) {
        val entity = data[position]
        holder.itembinding.apply {
            //GlideImgLoader.loadImage(guanzhuUser.context,entity.headImg,guanzhuUser)
            tv01.setText(entity.username)
        }
    }
}